var ReceAndSend = { };

ReceAndSend.addSubmit = function() {

    if($('#receive_time').val()==''){
        Feng.info("接收时间不能为空");
        return false;
    }
    if($('#send_time').val()==''){
        Feng.info("发送时间不能为空");
        return false;
    }
    if(typeof($("input[name='process_method']:checked").val()) == "undefined"){
        Feng.info("处理方式不能为空");
        return false;
    }
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/orderBack/receAndSendAdd", function(data){
        if(data.code==200){
           Feng.success("添加成功!");
            window.parent.table1.table.refresh();
            window.parent.ids.splice(0,window.parent.ids.length);
            window.parent.removeAll();
            parent.layer.close(window.parent.table1.layerIndex);
        }else{
            Feng.success(data.message + "!");
        }

    },function(data){
        Feng.error("添加失败!" + data.message + "!");
    });
    ajax.set("ids",$('#ids').val());
    ajax.set("receive_time",$('#receive_time').val());
    ajax.set("send_time",$('#send_time').val());
    ajax.set("sender",$('#sender').val());
    ajax.set("receiver",$('#receiver').val());
    ajax.set("process_method",$("input[name='process_method']:checked").val());
    ajax.set("remark",$('#remark').val());
    ajax.start();
}

ReceAndSend.close = function() {
    parent.layer.close(window.parent.table1.layerIndex);
}
$(function () {
    $('#receive_time').val(laydate.now(0, 'YYYY-MM-DD'));
    $('#send_time').val(laydate.now(0, 'YYYY-MM-DD'));
});
